import request from '@/utils/request'

// 新增
export function addFileWord(data) {
  return request({
    url: '/system/oa/FileWord/saveFileWord',
    method: 'post',
    data: data
  })
}

//修改
export function updateFileWord(data) {
  return request({
    url: '/system/oa/FileWord/saveFileWord',
    method: 'post',
    data: data
  })
}

//请求列表
export function listFileWord(query) {
  return request({
    url: '/system/oa/FileWord/listFileWord',
    method: 'get',
    params: query
  })
}

export function listFileWordForKey(key) {
  return request({
    url: '/system/oa/FileWord/listFileWordForKey',
    method: 'get',
    params: key
  })
}

//获取单个记录
export function getFileWord(id) {
  return request({
    url: '/system/oa/FileWord/' + id,
    method: 'get'
  })
}

// 字号状态修改
export function changeFileWordStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/oa/FileWord/changeStatus',
    method: 'put',
    data: data
  })
}

//数据删除
export function delConfig(id) {
  return request({
    url: '/system/oa/FileWord/' + id,
    method: 'delete'
  })
}
